In many computer programs, a single computer file is used to store many different pieces of data, referred to herein as chunks. Typically, different pieces of data, or chunks, are related in the sense that a chunk is subordinate to or owned by another chunk. For example, a page layout program may have the notion of a "frame" as an area in a document where information is to be displayed on a page of the document. Each frame has certain attributes, collectively known as "frame data", associated with the frame, such as the location, shape, contents, border style, etc. This frame data is typically stored as a chunk of data in a computer data file associated with the document. Some of these frame attributes may be references to other chunks of data that are stored separate from the frame data. For example, the "contents" attribute may be a reference to the information that should be displayed in the frame, such as a picture or text. Similarly, the "border" attribute may be a reference to the border data, which is stored in a distinct chunk within the document file. The content chunk and border chunk are subordinate to, or owned by, the frame chunk in that the frame chunk references them.
A common operation on a chunk of data, such as the frame chunk described above, is to copy it and all of its subordinate chunks to a different computer data file. Because of inefficiencies in the storage mechanism, the code to perform this copy operation typically needs to know how the frame chunk references other chunks, where the locations of these references are stored, and how to resolve those references to find the actual data for the subordinate chunks. If a program also needed to copy other types of chunks of data, distinct code must be written to perform this type of copy operation.
A typical prior art data structure, such as OLE Compound Files distributed by Microsoft Corporation, utilizes a heterogeneous file structure where a node is either a "storage" or a "stream," but not both. This data structure is described in the book by Kraig Brockschmidt, INSIDE OLE (Second Edition), Microsoft Press, ISBN 1-55615-843-2. A storage is a computer data item that stores a list of references to other discrete items of information, each of which is either another storage or a data stream. These referenced items are said to be children of the storage and the storage is the parent of each of these items. A stream is a data item comprising a "chunk" of information, for example a picture. Nodes in an OLE Compound File form a tree, where every node except the top level node has a unique parent node. The top level or root node has no parent. All internal nodes, that is nodes that have at least one child, are storages. Leaf nodes, that is nodes having no children, may either be streams or empty storages. Note that a stream cannot have children and a storage cannot have data other than its list of children. Also. a child node cannot be shared by more than one storage.
Referring in this regard to FIG. 1, a typical OLE Compound File may be represented in a graphical fashion as a structure or tree 5 comprising related nodes 7. An OLE Compound File may include a number of storages and streams. For example, in FIG. 1 the node A, being a storage, contains nodes B, C, and D. Node B is itself a storage containing data streams E and F and storage G. Storage G is empty. Node C is a data stream; node D is a storage containing nodes H and I, of which H is a storage containing streams J and K.
Because of the tree-based nature of the structure, it is possible to establish an ownership relationship between two related nodes. However, the tree structure is too restrictive. The tree structure of an OLE Compound File does not allow a stream to be shared by more than one storage. Nor is a node allowed to both contain data and have children.
For example, if the data file 5 represented by the tree shown in FIG. 1 contained redundant information, e.g., if streams F and I are identical, there is no convenient way to store just one copy of the information and still use the information in both contexts. For example, assume that node A represents a page layout program document, nodes B and D represent individual frames within that document and nodes F and I represent the pictures to be displayed by these frames. If the two frames are to display the same picture, the picture data must be duplicated in the file--it must exist in both stream F and stream I. Moreover, since the storage B can contain no data, a special stream, say E, is required to store additional frame attributes such as size and location of the frame.
Suppose now that node H represents the border to use for frame D, stream J is the picture to use for all four corners of the border and stream K is the picture to use for all four sides of the border. The tree structure cannot reflect this multiple usage. The tree structure cannot distinguish between this case and the case where stream J is to be used for the top left corner of the border and stream K is to be used for all other corners and all sides.
Accordingly, the use of a tree-based file structure leads to certain inefficiencies in data storage for some types of computer application programs. These inefficiencies are most pronounced where ownership relationships can be established between data items, and a single data item may be used in more than one context. There is thus a need for a computer data file storage method and system that allows for establishment of ownership relationships between data items, without the restriction that a node have a unique owner. It would also be convenient if the method would allow multiple ownership relationships between two nodes and allow nodes to both contain data and own other nodes.